import { Component } from "@angular/core"
import { TranslateService } from '@ngx-translate/core';
import { NavParams,App } from "ionic-angular"
import { PostrentPage } from "./rent/rent" 
import { PostbuyPage } from "./buy/buy" 
import { PostperPage } from "./per/per" 
import { PostservicePage } from "./service/service"
import { NativeStorage } from '@ionic-native/native-storage';
@Component({
    styles: [`
        .content-padding{
            padding:2rem 1.5rem;
        }
        .hc-cell{
            display:flex;
            justify-content: space-between;
        }
        .hc-cell-item{
            text-align:center;
        }
        .hc-cell-item i{
            color:#fff;width:4rem;height:4rem;line-height:4rem;border-radius:2rem;font-size:2.5rem;display:inline-block;
        }
        .hc-cell-item span{
            margin-top:1rem;color:#333333;display:block;
        }
        p{
            margin-top:2rem;color:#666666;
        }
    `],
    templateUrl: "mypost.html",
})

export class MypostPage{
    rent:any
    buy:any
    per:any
    service:any
    isRoot=false;
    constructor(
        private navParams:NavParams,
        private app:App,
        private translate: TranslateService,
        private storage: NativeStorage
    ){
        this.rent = PostrentPage
        this.buy = PostbuyPage
        this.per = PostperPage
        this.service = PostservicePage
        this.isRoot = this.navParams.get('isRoot')?true:false;
        translate.setDefaultLang('en');
    }
    ionViewDidEnter(){
      this.storage.getItem('lang').then(res=>{
          this.translate.use(res)
      })
    }
    goto(page){
        this.app.getRootNav().push(page)
    }
}